package com.itheima.health.controller.user;

import com.itheima.health.common.MessageConst;
import com.itheima.health.pojo.CheckGroup;
import com.itheima.health.pojo.Setmeal;
import com.itheima.health.result.Result;
import com.itheima.health.service.ReservationService;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.operator.MacCalculator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("mobile/setmeal")
@Slf4j
public class ReservationController {
    @Autowired
    private ReservationService reservationService;
    /*
    * 查询套餐及关联表
    * */
    @GetMapping("/getSetmeal")
    public Result getSetmeal(){
     List<Setmeal> setmeal = reservationService.getSetmealAll();
     return new Result(true, MessageConst.GET_SETMEAL_LIST_SUCCESS,setmeal);
    }
    /*
    *根据查询套餐详情
    * */
    @GetMapping("findById")
    public Result getBidall(Integer id){
       Setmeal setmeal = reservationService.fianByid(id);
       return new Result(true,MessageConst.QUERY_SETMEALLIST_SUCCESS,setmeal);
    }
}
